<?php
function top_pages($title,$name,$list,$type,$unit){
print <<<EOT
<!-- Start -->
<div id="content-top-box">
	<h1>$title </h1>
	<ul>
		<li>
			<span class="top-num-title">序号</span>
			<span class="top-user-title">$name</span>
			<div id="content-top-box-num-title">
				单位:$unit
			</div>
		</li>
EOT;

$mysql_top = mysql_query("SELECT * FROM  `$list` ORDER BY  `$type` DESC LIMIT 0 , 10");
$top_i=0;
while($top = mysql_fetch_array($mysql_top)){
$top_i++;

if($type=="warn"){
$email=$top['qq'];
}else{
$email=$top['email'];
} 

$top_num=$top[''.$type.''];

if ($top_i %2==0){
$top_li_style="top-li-style1";
}else{
$top_li_style="top-li-style2";
}

if ($type=="length"){
$top_num=round($top_num/60,0);
}

print <<<EOT
<li class="$top_li_style">
	<span class="top-num">$top_i</span>
	<span class="top-user">$email</span>
	<div id="content-top-box-num">
		$top_num $unit
	</div>
</li>
EOT;

}

print <<<EOT
	</ul>
</div>
<!-- Eed -->
EOT;
}

?>